﻿using System.Windows;
using Microsoft.WindowsAPICodePack.Shell;
using System.Collections.Generic;
using System.Windows.Media.Imaging;
using System;
using System.Windows.Controls;

namespace WpfMultitouchImageSearch
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            // Enable Glass
            //this.Loaded += (s, e) =>
            //{
            //    GlassEffectHelper.EnableGlassEffect(this);
            //};

            //this.Loaded += (s, e) =>
            //    {
            //        for (int i = 0; i < 7; i++)
            //        {
            //            Uri uri = new Uri(Environment.CurrentDirectory + "\\Assets\\" 
            //                + i + ".jpg");
            //            BitmapImage bi = new BitmapImage(uri);

            //            Image img = new Image();
            //            img.Source = bi;
            //            _scatterView.Items.Add(img);
            //        }
            //    };
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //SearchInLibraries(textBox1.Text);
        }

        private void SearchInLibraries(string searchtext)
        {
            //SearchCondition searchCondition =
            //    SearchConditionFactory.ParseStructuredQuery(searchtext);

            //ShellSearchFolder searchFolder =
            //    new ShellSearchFolder(
            //        searchCondition,
            //        (ShellContainer)KnownFolders.Libraries);

            //try
            //{
            //    //IEnumerator<ShellObject> resul<t = searchFolder.GetEnumerator();

            //    List<ShellObject> help = new List<ShellObject>();
            //    foreach (var i in searchFolder)
            //    {
            //        help.Add(i);
            //    }
            //    _scatterView.ItemsSource = help;
            //}
            //catch
            //{
            //    searchFolder.Dispose();
            //    searchFolder = null;
            //}
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //SearchInLibraries(textBox1.Text);
        }
    }
}
